package org.bugjail.servlet.form.create;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.bugjail.servlet.BasicUIServlet;

/**
 * Servlet implementation class for Servlet: NewSuiteFormServlet
 * 
 */
public class NewSuiteFormServlet extends BasicUIServlet {

	static final long serialVersionUID = 1L;

	@Override
	protected void write(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		int testdesignid = Integer.parseInt(request
				.getParameter("testdesignid"));

		PrintWriter pw = response.getWriter();

		pw.println("<form method='post' action='NewSuiteServlet'>");
		pw
				.println("Suite name:<br><input type='text' name='name' maxlength='50' /><br>");
		pw
				.println("Suite description:<br><textarea name='description'></textarea><br>");
		pw.println("<input type=hidden name='testdesignid' value='"
				+ testdesignid + "' />");
		pw.println("<input type=submit value='Create' />");
		pw.println("&nbsp;<a href='SuiteServlet?testdesignid="+testdesignid+"'>Cancel</a>");
		pw.println("</form>");
	}

	@Override
	protected String pageTitle() {
		return "Create new suite";
	}

	@Override
	protected void beforeAction(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
	}
}